package com.zyy.joseata.advice;

import org.springframework.aop.TargetSource;
import org.springframework.aop.framework.autoproxy.AbstractAutoProxyCreator;
import org.springframework.beans.BeansException;
import org.springframework.stereotype.Component;

/**
 * @author zhangyy
 */
//@Component
public class AnnotationProxyCreator extends AbstractAutoProxyCreator {

    @Override
    protected Object[] getAdvicesAndAdvisorsForBean(Class<?> aClass, String s, TargetSource targetSource) throws BeansException {
        if(aClass.getSimpleName().equals("UserServiceImpl")){
            return new Object[]{new AnnotationInterceptor()};
        }
        return DO_NOT_PROXY;
    }
}
